[##include file="common/header.tpl.php"##]
[##include file="common/nav.tpl.php"##]
<div id="main">
	<p><a href="[##$adminurl##]/?m=material&a=prop">添加道具</a></p>
    <form id="game_form" method="post" style="margin-top:20px;" action="[##$adminurl##]/?m=kingdomslady&a=map" >
 	游戏：<select name="game" >
       <option value="app_factory_prop" [##if $game == 'app_factory_prop'##]selected="selected"[##/if##] onclick="window.location.href='?m=material&a=game_prop&game=app_factory_prop';">疯狂工厂</option>
       <option value="app_kingdoms_prop" [##if $game == 'app_kingdoms_prop'##]selected="selected"[##/if##] onclick="window.location.href='?m=material&a=game_prop&game=app_kingdoms_prop';">三国夫人</option>
       <option value="app_showhand_prop" [##if $game == 'app_showhand_prop'##]selected="selected"[##/if##] onclick="window.location.href='?m=material&a=game_prop&game=app_showhand_prop';">梭哈</option>
       <option value="app_mora_prop" [##if $game == 'app_mora_prop'##]selected="selected"[##/if##] onclick="window.location.href='?m=material&a=game_prop&game=app_mora_prop';">猜拳</option>
       <option value="app_21_prop" [##if $game == 'app_21_prop'##]selected="selected"[##/if##] onclick="window.location.href='?m=material&a=game_prop&game=app_21_prop';">21点</option>
    </select>
  <table class=gridView>
  <thead>
  <tr>
    <td>ID</td>
    <td>名称</td>
    <td>价格</td>
    <td>类型</td>
    <td>修改人</td>
    <td>最后修改时间</td>
    <td>操作</td>
  </tr>
  </thead>
  [##foreach from=$list item=item##]
  <tr id="prop_[##$item.id##]">
    <td>[##$item.id##]</td>
    <td id="prop_name_[##$item.id##]">[##$item.name|escape##]</td>
    <td>[##$item.price##]</td>
    <td>[##$type[$item.type]##]</td>
    <td>[##$item.uin##]</td>
    <td>[##$item.time|formatTime:'Y-m-d H:i:s'##]</td>
    <td>
    <a href="[##$adminurl##]/?m=material&a=prop&id=[##$item.id##]&game=[##$game##]">编辑</a> | <a href="#" onClick="delete_prop([##$item.id##],'[##$game##]'); return false;">删除</a>
    </td>
  </tr>
  [##/foreach##]
</table>
     </form>
</div>
<script type="text/javascript">
// 绑定表单提交事件
function delete_prop(id,game) {
	var name = $('#prop_name_' + id).text();
	if( confirm('确定要删除《' + name + '》吗？') ) {
		var submit_url = '[##$adminurl##]/?m=material&a=porpdelete';
		$.post(submit_url , {'prop_id' : id,'game' : game} , function(d) {
			if(d.code) return alert(d.msg);

			alert(d.msg);
			$('#prop_' + id).fadeOut();
		} , 'json');
	}
}
</script>
[##include file="common/footer.tpl.php"##]